#pragma once
#include "DXAMLCommon.h"
#include "CXcpList.h"



class CXcpValueStoreTable
{
public: 
	struct HashNode
	{
	public: 
		void * key;
		struct IValueStore * value;
		HashNode(void * key, struct IValueStore * pValue);
		HashNode(void * key);
		HashNode();
		~HashNode();
	};

public: 
	CXcpValueStoreTable(XUINT32 nHashSize);
	~CXcpValueStoreTable();
	XUINT32 Release();
	XUINT32 Hash(void * key);
	HRESULT Add(void * key, struct IValueStore * pValue);
	HRESULT Remove(void * key);
	HRESULT GetValue(void * key, struct IValueStore * * ppValue);
	XBOOL Exists(void * key);
	HRESULT Clean();
	XBOOL TableCreated();
private: 
	XUINT32 m_cRef;
	CXcpList<CXcpValueStoreTable::HashNode> * * m_ppHashBuckets;
	XUINT32 m_nHashSize;

};
